package cn.edu.scau.cmi.tangqingning.multiton;

import java.util.ArrayList;

public class Marshal {
    private String name = "";
    private static ArrayList<Marshal> marshalArr = new ArrayList<Marshal>();

    private Marshal(String name){
        this.name = name;
    }

    public static ArrayList<Marshal> getInstance(String name){
        if(marshalArr.size() < 10){
            marshalArr.add(new Marshal(name));
        }
        return marshalArr;
    }

    public String getName() {
        return this.name;
    }


}
